'''
try:
    num = int(input('请输入一个整数:'))
    sum = num * num
  
except Exception:
    print('出错了')
else:
    print('结果为:',sum)



class InvalidAgeError(Exception):
    def __init__(self, age):
        self.age = age


def validAge(age):
    try:
        if age < 0 or age >150:
            raise InvalidAgeError('您输入的年龄无效 请重新输入')
        print(f'您今年{age}岁了！')
    except InvalidAgeError as error :
        print('出错了,原因是:',error)


n = int(input('请输入您的年龄:'))
validAge(n)


'''


class  TemperatureConversionError(Exception):
    def __init__(self, temp):
        self.temp = temp




























